﻿<?php if(!empty($subvo)){

    $v = $subvo;

    $subvo = '';

}

if(!empty($subsubvo)){

    $v = $subsubvo; 

    $subsubvo = '';

}

?><?php if(!empty($v['dataname'])){

                $v['content'] = $v['dataname'];

                

        }else{ 

            $listdata =  $v['content'] = unserialize($v['content']);

        }

         ?>

<!-- 如果是ajaxlist请求，不输出这部分内容 <?php if(!isset($_GET['ajaxlist']) || is_spider()){?> -->

<div class="viewBox myBox<?php echo $v['id'];?>" id="myBox<?php echo $v['id'];?>" <?php if($_SESSION[C('USER_AUTH_KEY')]){?> sortID="<?php echo $v['sort'];?>" modulesID="<?php echo $v['id'];?>" title="<?php echo $v['title'];?>" deleteUrl="<?php echo U('/Admin/Modules/delete',array('id'=>$v['id']));?>" settingUrl="<?php echo U('/Admin/Modules/edit',array('id'=>$v['id']));?>" isEdit="0"<?php }?>>

  

  <div class="panel panel-primary">

    <?php include(TMPL_PATH.'Home/TemplateDefault/Public-Moduletitle'.C('TMPL_TEMPLATE_SUFFIX')); ?>

    <div class="panel-body">

      <div style="height:48px;"></div> 

      <ul class="nav-glyphicons-list navbar-fixed-top" style="background-color:#F5F5F5; border-bottom:1px solid #ccc;">

        <li style="text-align:center;" class="first"> <a href="javascript:history.go(-1);" onClick="setSort<?php echo $v['id'];?>();" target="_blank"><span class="fa fa-chevron-left" aria-hidden="true"></span> </a></li>

        <li style="text-align:center;" class="last"> <a href="__APP__/" target="_blank"><span class="fa fa-home" aria-hidden="true"></span></a></li>

      </ul>

      

      

      

      

      <form id="sgoodsList<?php echo $v['id'];?>form" action="__APP__/QuanBuShangPin" class="bs-example bs-example-form" data-example-id="input-group-with-button" style="padding-top:2px; margin:0 45px; position:fixed; z-index:2000; top:3px;">

      

      

      <input type="hidden" name="cateself" value="0">

      <input type="hidden" name="id" value="<?php echo $cid;?>"><input type="hidden" name="isp" value="1">

      

      

        <div class="row">

          <div class="col-lg-12">

            <div class="input-group">

              <input type="text" class="form-control" name="keywords" value="{$keywords}" placeholder="输入关键词">

              <span class="input-group-btn">

              <button class="btn btn-default" type="submit"><i class="glyphicon glyphicon-search"></i></button>

              </span> </div>

          </div>

        </div>

      </form>

      

      

      

      

      

      

      

      <form style="display:none;" id="goodsList<?php echo $v['id'];?>form" action="<?php echo U('Home/Product_category/index');?>" class="bs-example bs-example-form" data-example-id="input-group-with-button" style="padding-top:2px; margin:0 45px; position:fixed; z-index:2000; top:3px;">

      

      

      <input type="hidden" name="cateself" value="0">

      <input type="hidden" name="id" value="<?php echo $cid;?>"><input type="hidden" name="isp" value="1"><input type="hidden" name="modulesID" value="<?php echo $v['id'];?>"><input type="hidden" name="ajaxlist" value="1">

      

      

        <div class="row">

          <div class="col-lg-12">

            <div class="input-group">

              <input type="text" class="form-control" name="keywords" value="{$keywords}" placeholder="输入关键词">

              <span class="input-group-btn">

              <button class="btn btn-default" type="submit"><i class="glyphicon glyphicon-search"></i></button>

              </span> </div>

          </div>

        </div>

      </form>

      <div class="row list<?php echo $v['id'];?>"> 

        <!-- 左边分类 -->

        <div class="col-xs-3 col" style="overflow-y:scroll;">

          <div class="list-group categoryList<?php echo $v['id'];?> categoryListniceScroll<?php echo $v['id'];?>" style="margin-right:8px;overflow-y:scroll;">

          

          

          <a href="##" cid="<?php echo $cid;?>" class="list-group-item all">全部商品</a>

            <?php foreach($subCategory as $key => $val){?>

            <a href="##" cid="<?php echo $val['id'];?>" class="list-group-item <?php if($val['id'] == $category_id){?>active<?php }?>"><?php echo $val['title'];?></a>

            <?php }?>

          </div>

        </div>

        

        

        

  

        <!-- 左边分类结束 -->

        

        

        

        <!-- 右边列表 -->

        <div class="col-xs-9 col" style="overflow-y:scroll;">
		<!--轮播模块-->
		<div class="categroy_banner" style="margin-bottom: .3rem;"></div>
       

        

        

        

          <?php if($list){?>

          <div id="categoryList<?php echo $v['id'];?>" class="row categoryList<?php echo $v['id'];?> categoryListniceScroll<?php echo $v['id'];?>"  style=" display:none;"> 

            

            </div>

            

            

            <form action="<?php echo U('Home/Product_category/index');?>" id="categoryList<?php echo $v['id'];?>form"><input type="hidden" name="id" value="<?php echo $cid;?>"><input type="hidden" name="issubcate"><input type="hidden" name="modulesID" value="<?php echo $v['id'];?>"><input type="hidden" name="ajaxlist" value="1"></form>

            

            

       <?php }?>

       

        <?php }?>

       

       

       

       

       

       

       

       <!-- 如果是ajaxlist请求，不输出这部分内容 <?php if(((isset($_GET['ajaxlist']) && isset($_GET['issubcate'])) || is_spider()) || (isset($_GET['issubcate']) && !empty($listdata))){?> -->

            <!-- 分类列表 --> 

            

            <?php foreach($subcate as $key => $val){?>

            <div class="col-xs-4 col">

              <div class="thumbnail"> <a href="__APP__/<?php echo $val['name'];?>" cid="<?php echo $val['id'];?>"><img data-src="<?php echo $val['img_url'];?>" alt="" src="<?php echo getThumbPath($val['img_url'],$v['thumbtype']);?>" data-holder-rendered="true" style="width: 100%; display: block;"></a>

                <div class="caption">

                  <h3><a href="##" cid="<?php echo $val['id'];?>"><?php echo $val['title'];?></a></h3>

                </div>

              </div>

            </div>

            <?php }?>

            

            

            

            <!-- 分类列表结束 --> 

           <?php }?> 

          

         

          

          

          <!-- 如果是ajaxlist请求，不输出这部分内容 <?php if(!isset($_GET['ajaxlist']) || is_spider()){?> -->

          <div class="row goodsList<?php echo $v['id'];?> goodsListniceScroll<?php echo $v['id'];?>" style=""> 

          

          

          <div id="goodsList<?php echo $v['id'];?>"> 

            <?php }?>

            

            

            <!-- 商品列表 -->

            <!-- 如果是ajaxlist请求，不输出这部分内容 <?php if(((isset($_GET['ajaxlist']) && isset($_GET['isp'])) || is_spider()) || (isset($_GET['isp']) && !empty($listdata))){?> -->

            <?php foreach($list as $key => $val){?>

            
			  

            <?php }?> 

            <?php }?>

            <!-- 商品列表结束 --> 

            

            

            

            

            

            <!-- 如果是ajaxlist请求，不输出这部分内容 <?php if(!isset($_GET['ajaxlist']) || is_spider()){?> -->

            </div>

            <div style="clear:both;"></div>

            <div id="goodsList<?php echo $v['id'];?>pages"></div>

            

            

          </div>

          

        </div>

        <!-- 右边列表结束 -->

        

      </div>

    </div>

  </div>

  <?php if(strtolower(GROUP_NAME) != 'admin'){?>

  <script>

  

  

  

      $(document).ready(function(e) {

		  

		  

		  

		  

		  

		  

		  

		  

		  var windowheight = $(window).height();

		  $('.viewBox').each(function(index, element) {

			  if($(this).attr('id') != 'myBox<?php echo $v['id'];?>'){

				  //alert($(this).parents('.viewBox').length);

				  if($(this).parents('.viewBox').length == 0){

					  windowheight -= $(this).outerHeight(true);

				  }

                  

			  } 

          });

		  

		  

		  $('#myBox<?php echo $v['id'];?> .goodsList<?php echo $v['id'];?>').parent().height(windowheight - 10 - $('#myBox<?php echo $v['id'];?> .nav-glyphicons-list').height());

		  $('#myBox<?php echo $v['id'];?> .goodsList<?php echo $v['id'];?>').parent().prev().height(windowheight - 10 - $('#myBox<?php echo $v['id'];?> .nav-glyphicons-list').height());

		  if($('.categoryList<?php echo $v['id'];?> .col').length > 0){

		      $('.goodsList<?php echo $v['id'];?>').remove();

		  }

		     

		  

        $('.categoryList<?php echo $v['id'];?> a').each(function(index, element) {

            $(this).click(function(e) {

				

				if(index == 0){

					$('#goodsList<?php echo $v['id'];?>form').find('input[name="cateself"]').val(0);

				}else{

					$('#goodsList<?php echo $v['id'];?>form').find('input[name="cateself"]').val(1);

				}

				

				

				$('#goodsList<?php echo $v['id'];?>form').find('input[name="id"]').val($(this).attr('cid'));

				$('#goodsList<?php echo $v['id'];?>form').submit();

            });

        }); 

		

		

		 

		 

		

		$('#categoryList<?php echo $v['id'];?>').ajaxlist({autoload:false, success:function(){

			if($('#goodsList<?php echo $v['id'];?>').children('.col-xs-4').length == 0){

				$('#categoryList<?php echo $v['id'];?>').show();

			}else{

				$('#categoryList<?php echo $v['id'];?>').hide();

			} 

			

			$('#categoryList<?php echo $v['id'];?> a').each(function(index, element) {

				$(this).click(function(e) {

					

					

					

					$('#categoryList<?php echo $v['id'];?>form').find('input[name="id"]').val($('#goodsList<?php echo $v['id'];?>form').find('input[name="id"]').val());

					$('#goodsList<?php echo $v['id'];?>form').find('input[name="cateself"]').val(1);

					$('#goodsList<?php echo $v['id'];?>form').find('input[name="id"]').val($(this).attr('cid'));

					$('#goodsList<?php echo $v['id'];?>form').submit();

				});

			}); 

			

		}});

		//xx

		$('#goodsList<?php echo $v['id'];?>').ajaxlist({append:true,nodata:'',success:function(){

			$('#categoryList<?php echo $v['id'];?>form').find('input[name="id"]').val($('#goodsList<?php echo $v['id'];?>form').find('input[name="id"]').val());

			

			

			$('#categoryList<?php echo $v['id'];?>form').submit();

		}});

		

		

			 

		

		

		

		

		

		

		

    });
    
    
    //  页面轮播模块
//初始加载
   	$.ajax({
		type: "get",
		url: "/Index/index/modulesID/54344",
		data: {},
		dataType: "json",
		success: function(data) {
			$('.categroy_banner').html(data.data);
		}
	});
//	点击加载
$('.categoryListniceScroll26992 a').on("click", function() {
		var i=$(this).index();
		if(i==0){
			id=54344;
		}else if(i==1){
			id=54351;
		}else if(i==2){
			id=54352;
		}else if(i==3){
			id=54353;
		}else if(i==4){
			id=54354;
		}else if(i==5){
			id=54356;
		}else if(i==6){
			id=54357;
		}else if(i==7){
			id=54359;
		}else if(i==8){
			id=54360;
		}else if(i==9){
			id=54362;
		}else if(i==10){
			id=54361;
		}else if(i==11){
			id=54365;
		}else if(i==12){
			id=54363;
		}	
//		加载
		$.ajax({
		type: "get",
		url: "/Index/index/modulesID/"+id,
		data: {},
		dataType: "json",
		success: function(data) {
			$('.categroy_banner').html(data.data);
		}
	});
	})

  </script> 

  <?php } ?>

</div>

<?php } ?>